using Microsoft.VisualBasic;
using DevExpress.Data;
using DevExpress.Utils;
using DevExpress.XtraEditors;
using DevExpress.XtraEditors.Repository;
using DevExpress.XtraGrid;
using DevExpress.XtraGrid.Columns;
using DevExpress.XtraGrid.Views.Base;
using DevExpress.XtraGrid.Views.Grid;
using Microsoft.VisualBasic.CompilerServices;
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.OleDb;
using System.Diagnostics;
using System.Drawing;
using System.Runtime.CompilerServices;
using System.Windows.Forms;
namespace ePlanSysOman
{
    public partial class frmCards
    {
        public static frmCards newfrmCards1 = new frmCards();//JMR
        public OleDbDataAdapter daCards = new OleDbDataAdapter();
       
        private void  // ERROR: Handles clauses are not supported in C#
    frmCards_Activated(object sender, System.EventArgs e)
        {
            //this.frmCards_Load();            
            //secondFrmCardsLoad = true;
            if (Module1.newModule.Iscarddif)//JMR
            {
                Module1.newModule.Iscarddif = false;
                dsCards.Clear();
                Module1.newModule.Createadapter(this.dsCards, "tblGeneral", ("genProgram ='" + frmMain.start.cmbProgram.Text + "'"), ref this.daCards);//JMR -- look at -- has to do with the ref keyword
            }
            else
            {
                try
                {
                    daCards.AcceptChangesDuringUpdate = true;
                    daCards.Update(dsCards, "tblGeneral");
                }
                catch (Exception ex)
                {

                }
                try
                {
                    //OleDbCommand cmd = new OleDbCommand();
                    //cmd.Connection = Module1.newModule.Cn;
                    //cmd.CommandType = CommandType.Text;
                    //cmd.CommandText = "select * from tblGeneral where genProgram ='Oman'";
                    //daCards.SelectCommand = cmd;
                    this.daCards.Fill(this.dsCards);
                    this.gridCards.DataSource = this.dsCards.Tables["tblGeneral"];
                    this.gridCards.RefreshDataSource();
                }
                catch (Exception ex)
                {

                }
            }

        }



        private void  // ERROR: Handles clauses are not supported in C#
    frmCards_FormClosing(object sender, System.Windows.Forms.FormClosingEventArgs e)
        {
            //JMR
            if (this.dsCards.HasChanges())
            {
                try
                {
                    this.daCards.Update(this.dsCards, "tblGeneral");
                }
                catch (Exception exception1)
                {

                    Exception exception = exception1;

                }
            }
        }

        private void  // ERROR: Handles clauses are not supported in C#
    frmCards_GotFocus(object sender, System.EventArgs e)
        {
            try
            {
                this.daCards.Fill(this.dsCards, "tblGeneral");
                this.gridCards.DataSource = this.dsCards.Tables["tblGeneral"];
                this.gridCards.Refresh();
            }
            catch (Exception ex)
            {

            }
        }



        private void  // ERROR: Handles clauses are not supported in C#
    frmCards_Load(object sender, System.EventArgs e)
        {
                Module1.newModule.Createadapter(this.dsCards, "tblGeneral", ("genProgram ='" + frmMain.start.cmbProgram.Text + "'"), ref this.daCards);//JMR
                this.gridCards.DataSource = this.dsCards.Tables["tblGeneral"];
                this.gridCards.EmbeddedNavigator.ButtonClick += Grid_DataNavigator1_ButtonClick;           

        }
        private void Grid_DataNavigator1_ButtonClick(object sender, NavigatorButtonClickEventArgs e)
        {
            clsData data = new clsData();
            if ((e.Button.ButtonType == NavigatorButtonType.Remove))
            {
                DialogResult result = XtraMessageBox.Show("Do you want to delete the current card?", "Confirm deletion", MessageBoxButtons.YesNo, MessageBoxIcon.Question);//JMR
                if ((object.ReferenceEquals(this.GridView1.GetRowCellValue(Module1.newModule.rowhan, "genPlId"), DBNull.Value)))
                {
                    Module1.newModule.rowt = "0";
                }
                else if ((result == DialogResult.No))
                {
                    e.Handled = true;
                }
                else
                {
                    Module1.newModule.rowt = Conversions.ToString(this.GridView1.GetRowCellValue(this.GridView1.FocusedRowHandle, "genPlId"));
                    Module1.newModule.STRPLANO = Conversions.ToString(this.GridView1.GetRowCellValue(this.GridView1.FocusedRowHandle, "genPlannumber"));
                    Module1.newModule.STRPLANO = Module1.newModule.STRPLANO.Trim();//look at
                    Module1.newModule.stath = Module1.newModule.STRPLANO;
                    DataSet aset = data.getData(("select comment FROM TBLECN where comment like '%" + Module1.newModule.stath + "%'"));
                    int num2 = (aset.Tables[0].Rows.Count - 1);
                    int i = 0;
                    while ((i <= num2))
                    {
                        Module1.newModule.ecnComment = Conversions.ToString(aset.Tables[0].Rows[i]["COMMENT"]);
                        string oldValue = ("Started Pl/c " + Module1.newModule.STRPLANO);
                        string str = ("Finished Pl/c " + Module1.newModule.STRPLANO);
                        Module1.newModule.ecnComment = Module1.newModule.ecnComment.Replace(oldValue, "");
                        Module1.newModule.ecnComment = Module1.newModule.ecnComment.Replace(str, "");
                        data.ExecuteSQL(string.Concat(new string[] {
              "UPDATE tblEcn set  comment ='",
              Module1.newModule.ecnComment,
              " 'where comment like '%",
              Module1.newModule.stath,
              "%'"
            }));
                        string stath = Module1.newModule.stath;
                        i += 1;
                        i += 1;
                    }
                    Module1.newModule.ClearCard(Module1.newModule.rowt);
                    data.ExecuteSQL(("DELETE * FROM TBLPLANO WHERE PlannoId = '" + Module1.newModule.rowt + "'"));
                    data.ExecuteSQL(("DELETE * FROM TBLGENERAL WHERE genPlId ='" + Module1.newModule.rowt + "'"));
                    data.ExecuteSQL(("DELETE * FROM TBLPLANO WHERE PlannoId = '" + Module1.newModule.rowt + "'"));
                    try
                    {
                        this.daCards.AcceptChangesDuringUpdate = true;
                        this.daCards.Update(this.dsCards, "tblGeneral");
                    }
                    catch (Exception exception1)
                    {
                        ProjectData.SetProjectError(exception1);
                        Exception exception = exception1;
                        ProjectData.ClearProjectError();
                    }
                    this.gridCards.RefreshDataSource();
                }
            }
        }


        private void  // ERROR: Handles clauses are not supported in C#
    gridCards_DoubleClick(object sender, System.EventArgs e)
        {
            //Application.DoEvents()
            //Dim f As Form

            //On Error Resume Next
            //For Each f In My.Application.OpenForms



            //    Select Case f.Name
            //        Case "frmCards"
            //            ' f.Close()
            //        Case "frmOps"
            //            opsisopened = True
            //        Case "frmElectrical"
            //            'CARDELECTRICAL = 1
            //            'plannumber1 = GridView1.GetRowCellValue(GridView1.GetSelectedRows(0), "genPlId")

            //            isOpened = True
            //        Case "frmElectrical1"
            //            'CARDELECTRICAL = 2
            //            'PlanNumber2 = GridView1.GetRowCellValue(GridView1.GetSelectedRows(0), "genPlId")

            //            isOpened = True
            //        Case "frmElectrical2"
            //            CARDELECTRICAL = 3
            //            isOpened = True
            //        Case "frmElectrical3"
            //            CARDELECTRICAL = 4
            //            isOpened = True
            //        Case "frmElectrical4"
            //            XtraMessageBox.Show("Too many cards opened")
            //            Exit Sub
            //        Case "frmBackShopl"
            //            isOpened = True
            //    End Select


            //Next f
            //frmWait.MdiParent = frmMain
            //frmWait.Show()

            //excist = True
            //Dim area As String


            //plnumber = GridView1.GetRowCellValue(GridView1.GetSelectedRows(0), "genPlId")


            //area = GridView1.GetRowCellValue(GridView1.GetSelectedRows(0), "genPlannumber")
            //'description = GridView1.GetRowCellValue(GridView1.GetSelectedRows(0), "Description")
            //' PlanNumber = PLANID
            //STRPLANO = area
            //CardNumber = area
            //AreaNo = 999
            //If area.Substring(0, 2) = 50 Then
            //    Cursor.Current = Cursors.WaitCursor

            //    If isOpened = False Then
            //        Dim frm As New frmElectrical
            //        frm.MdiParent = frmMain
            //        frm.Text = STRPLANO

            //        frm.Show()
            //    Else

            //        Dim frm1 As New frmElectrical
            //        frm1.Text = STRPLANO
            //        frm1.Show()
            //        frm1.BringToFront()
            //    End If



            //ElseIf area.Substring(0, 2) = 30 Then
            //    If isOpened = False Then
            //        Dim frm As New frmBackShopNew
            //        frm.MdiParent = frmMain
            //        frm.Text = STRPLANO
            //        frm.Show()
            //    Else
            //        plnumber = GridView1.GetRowCellValue(GridView1.GetSelectedRows(0), "genPlId")

            //        Dim frmb As New frmBackShopNew
            //        frmb.Text = STRPLANO
            //        frmb.Show()
            //    End If
            //Else
            //    Dim frmc As New frmOps

            //    If opsisopened = False Then
            //        editCard = True
            //        frmc.MdiParent = frmMain
            //        frmc.Text = STRPLANO
            //        frmc.Show()
            //    Else
            //        plnumber = GridView1.GetRowCellValue(GridView1.GetSelectedRows(0), "genPlId")

            //        frmc.Text = STRPLANO
            //        frmc.Show()
            //    End If
            //    plnumber = GridView1.GetRowCellValue(GridView1.GetSelectedRows(0), "genPlId")


            //End If


            //'   Cursor = Cursors.Arrow
            //frmWait.Close()
            Module1.newModule.isOpened = false;
            int num2 = 0;//JMR -- look at -- set num2 to something. Was thinking about 0, but don't want to mess up the program. -- ended up changing int num2 to int num2 = new int()
            try
            {
                int num3;
                int expressionStack_694_0;
                string name = "";
            Label_0001:
                num3 = 1;
                Application.DoEvents();
            Label_000A:
                ProjectData.ClearProjectError();
                int num = -2;
            Label_0013:
                num3 = 3;
                IEnumerator enumerator = Application.OpenForms.GetEnumerator();
                Form current = new Form();
                while (enumerator.MoveNext())
                {
                    current = (Form)enumerator.Current;
                Label_0039_loop:
                    num3 = 4;
                    name = current.Name;
                Label_0045_loop:
                    num3 = 7;
                    if ((name == "frmCards"))
                    {
                        goto Label_01A7_loop;
                    }
                Label_0065_loop:
                    num3 = 9;
                    if ((name != "frmOps"))
                    {
                        goto Label_0090_loop;
                    }
                Label_0081_loop:
                    num3 = 10;
                    Module1.newModule.opsisopened = true;
                    goto Label_01A7_loop;
                Label_0090_loop:
                    num3 = 12;
                    if ((name != "frmElectrical"))
                    {
                        goto Label_00BB_loop;
                    }
                Label_00AC_loop:
                    num3 = 13;
                    Module1.newModule.IsLoading = true;//JMR
                    Module1.newModule.isOpened = true;
                    goto Label_01A7_loop;
                Label_00BB_loop:
                    num3 = 15;
                    if ((name != "frmBackshopNew"))
                    {
                        goto Label_00E6_loop;
                    }
                Label_00D7_loop:
                    num3 = 0x10;
                    Module1.newModule.IsLoading = true;//JMR
                    Module1.newModule.isOpened = true;
                    goto Label_01A7_loop;
                Label_00E6_loop:
                    num3 = 0x12;
                    if ((name != "frmElectrical2"))
                    {
                        goto Label_011B_loop;
                    }
                Label_0102_loop:
                    num3 = 0x13;
                    Module1.newModule.CARDELECTRICAL = 3;
                Label_010C_loop:
                    num3 = 20;
                    Module1.newModule.isOpened = true;
                    goto Label_01A7_loop;
                Label_011B_loop:
                    num3 = 0x16;
                    if ((name != "frmElectrical3"))
                    {
                        goto Label_014D_loop;
                    }
                Label_0137_loop:
                    num3 = 0x17;
                    Module1.newModule.CARDELECTRICAL = 4;
                Label_0141_loop:
                    num3 = 0x18;
                    Module1.newModule.isOpened = true;
                    goto Label_01A7_loop;
                Label_014D_loop:
                    num3 = 0x1a;
                    if ((name != "frmElectrical4"))
                    {
                        goto Label_0180_loop;
                    }
                Label_0169_loop:
                    num3 = 0x1b;
                    XtraMessageBox.Show("Too many cards opened");//JMR
                    goto Label_06D0;
                Label_0180_loop:
                    num3 = 30;
                    if ((name != "frmBackShopnew"))
                    {
                        goto Label_01A7_loop;
                    }
                Label_019C_loop:
                    num3 = 0x1f;

                    Module1.newModule.isOpened = true;
                Label_01A7_loop:
                    num3 = 0x21;
                }

                goto skipped;
            Label_0039:
                num3 = 4;
                name = current.Name;
            Label_0045:
                num3 = 7;
                if ((name == "frmCards"))
                {
                    goto Label_01A7;
                }
            Label_0065:
                num3 = 9;
                if ((name != "frmOps"))
                {
                    goto Label_0090;
                }
            Label_0081:
                num3 = 10;
                Module1.newModule.opsisopened = true;
                goto Label_01A7;
            Label_0090:
                num3 = 12;
                if ((name != "frmElectrical"))
                {
                    goto Label_00BB;
                }
            Label_00AC:
                num3 = 13;
                Module1.newModule.IsLoading = true;//JMR
                Module1.newModule.isOpened = true;
                goto Label_01A7;
            Label_00BB:
                num3 = 15;
                if ((name != "frmBackshopNew"))
                {
                    goto Label_00E6;
                }
            Label_00D7:
                num3 = 0x10;
                Module1.newModule.IsLoading = true;//JMR
                Module1.newModule.isOpened = true;
                goto Label_01A7;
            Label_00E6:
                num3 = 0x12;
                if ((name != "frmElectrical2"))
                {
                    goto Label_011B;
                }
            Label_0102:
                num3 = 0x13;
                Module1.newModule.CARDELECTRICAL = 3;
            Label_010C:
                num3 = 20;
                Module1.newModule.isOpened = true;
                goto Label_01A7;
            Label_011B:
                num3 = 0x16;
                if ((name != "frmElectrical3"))
                {
                    goto Label_014D;
                }
            Label_0137:
                num3 = 0x17;
                Module1.newModule.CARDELECTRICAL = 4;
            Label_0141:
                num3 = 0x18;
                Module1.newModule.isOpened = true;
                goto Label_01A7;
            Label_014D:
                num3 = 0x1a;
                if ((name != "frmElectrical4"))
                {
                    goto Label_0180;
                }
            Label_0169:
                num3 = 0x1b;
                XtraMessageBox.Show("Too many cards opened");//JMR
                goto Label_06D0;
            Label_0180:
                num3 = 30;
                if ((name != "frmBackShopnew"))
                {
                    goto Label_01A7;
                }
            Label_019C:
                num3 = 0x1f;

                Module1.newModule.isOpened = true;
            Label_01A7:
                num3 = 0x21;
                skipped:
                if (enumerator is IDisposable)
                {
                    (enumerator as IDisposable).Dispose();
                }
            Label_01DD:
                num3 = 0x22;
                if (frmWait.newfrmWait1.IsDisposed)
                {
                    frmWait.newfrmWait1 = new frmWait();
                }
                frmWait.newfrmWait1.MdiParent = frmMain.start;
            Label_01FB:
                num3 = 0x23;
                frmWait.newfrmWait1.Show();
            Label_020F:
                num3 = 0x24;
                Module1.newModule.excist = true;
            Label_0219:
                num3 = 0x25;
                Module1.newModule.plnumber = Conversions.ToString(this.GridView1.GetRowCellValue(this.GridView1.GetSelectedRows()[0], "genPlId"));//JMR
            Label_0244:
                num3 = 0x26;
                string str = Conversions.ToString(this.GridView1.GetRowCellValue(this.GridView1.GetSelectedRows()[0], "genPlannumber"));
            Label_026B:
                num3 = 0x27;
                Module1.newModule.STRPLANO = str;
            Label_0275:
                num3 = 40;
                Module1.newModule.CardNumber = str;
            Label_027F:
                num3 = 0x29;
                Module1.newModule.AreaNo = Conversions.ToInteger(Module1.newModule.CardNumber.Substring(0, Module1.newModule.CardNumber.IndexOf("-")).Trim());//JMR converted to string
            Label_028D:
                num3 = 0x2a;
                if ((Convert.ToDouble(str.Substring(0, 2)) != 50))
                {
                    goto Label_034A;
                }
            Label_02B2:
                num3 = 0x2b;
                Cursor.Current = Cursors.WaitCursor;
            Label_02C1:
                num3 = 0x2c;
                if (Module1.newModule.isOpened)
                {
                    goto Label_030F;
                }
            Label_02D3:
                num3 = 0x2d;
                frmElectrical electrical = new frmElectrical();
            Label_02DD:
                num3 = 0x2e;
                electrical.MdiParent = frmMain.start;
            Label_02F2:
                num3 = 0x2f;
                electrical.Text = Module1.newModule.STRPLANO;
            Label_0302:
                num3 = 0x30;
                electrical.Show();
                goto Label_04FA;
            Label_030F:
                num3 = 50;
            Label_0314:
                num3 = 0x33;
                frmElectrical electrical2 = new frmElectrical();
            Label_031E:
                num3 = 0x34;
                electrical2.Text = Module1.newModule.STRPLANO;
            Label_032E:
                num3 = 0x35;
                electrical2.Show();
            Label_0339:
                num3 = 0x36;
                electrical2.BringToFront();
                goto Label_04FA;
            Label_034A:
                num3 = 0x39;
                if ((Convert.ToDouble(str.Substring(0, 2)) != 30))
                {
                    goto Label_041F;
                }
            Label_036F:
                num3 = 0x3a;
                if (Module1.newModule.isOpened)
                {
                    goto Label_03C1;
                }
            Label_0381:
                num3 = 0x3b;
                frmBackshopNew new2 = new frmBackshopNew();
            Label_038C:
                num3 = 60;
                new2.MdiParent = frmMain.start;
            Label_03A2:
                num3 = 0x3d;
                new2.Text = Module1.newModule.STRPLANO;
            Label_03B3:
                num3 = 0x3e;
                new2.Show();
                goto Label_04FA;
            Label_03C1:
                num3 = 0x40;
            Label_03C6:
                num3 = 0x41;
                Module1.newModule.plnumber = Conversions.ToString(this.GridView1.GetRowCellValue(Conversions.ToInteger(this.GridView1.GetSelectedRows()[0]), "genPlId"));//JMR -- Converted etc.GetSelectedRows() to int and got rid of the 0 inside it, then converted the whole thing to string
            Label_03F1:
                num3 = 0x42;
                frmBackshopNew new3 = new frmBackshopNew();
            Label_03FC:
                num3 = 0x43;
                new3.Text = Module1.newModule.STRPLANO;
            Label_040D:
                num3 = 0x44;

                new3.Show();
                goto Label_04FA;
            Label_041F:
                num3 = 0x47;
            Label_0424:
                num3 = 0x48;
                frmOps ops = new frmOps();
            Label_042F:
                num3 = 0x49;
                //if (Module1.newModule.opsisopened) //BJR
                //{
                    //goto Label_0480;
                //}
            Label_0441:
                num3 = 0x4a;
                Module1.newModule.editCard = true;
            Label_044B:
                num3 = 0x4b;
                ops.MdiParent = frmMain.start;
            Label_0461:
                num3 = 0x4c;
                ops.Text = Module1.newModule.STRPLANO;
            Label_0472:
                num3 = 0x4d;
                ops.Show();
                goto Label_04CE;
            Label_0480:
                num3 = 0x4f;
            Label_0485:
                num3 = 80;
                Module1.newModule.plnumber = (this.GridView1.GetRowCellValue(Conversions.ToInteger(this.GridView1.GetSelectedRows()[0]), "genPlId")).ToString();//JMR -- Converted etc.GetSelectedRows() to int and got rid of the 0 inside it, then converted the whole thing to string
            Label_04B0:
                num3 = 0x51;
                ops.Text = Module1.newModule.STRPLANO;
            Label_04C1:
                num3 = 0x52;
                ops.Show();
            Label_04CE:
                num3 = 0x54;
                Module1.newModule.plnumber = (this.GridView1.GetRowCellValue(Conversions.ToInteger(this.GridView1.GetSelectedRows()[0]), "genPlId")).ToString();//JMR -- Converted etc.GetSelectedRows() to int and got rid of the 0 inside it, then converted the whole thing to string
            Label_04FA:
                num3 = 0x56;
                frmWait.newfrmWait1.Close();
                goto Label_06D0;
                int expressionStack_51B_0 = num2;
                goto Label_051B;
            Label_0517:
                expressionStack_51B_0 = (num2 + 1);
            Label_051B:
                num2 = 0;
                switch (expressionStack_51B_0)
                {
                    case 1:
                        goto Label_0001;
                    case 2:
                        goto Label_000A;
                    case 3:
                        goto Label_0013;
                    case 4:
                        goto Label_0039;
                    case 5:
                    case 0x20:
                    case 8:
                    case 11:
                    case 14:
                    case 0x11:
                    case 0x15:
                    case 0x19:
                    case 0x1d:
                    case 0x21:
                        goto Label_01A7;
                    case 6:
                    case 7:
                        goto Label_0045;
                    case 9:
                        goto Label_0065;
                    case 10:
                        goto Label_0081;
                    case 12:
                        goto Label_0090;
                    case 13:
                        goto Label_00AC;
                    case 15:
                        goto Label_00BB;
                    case 0x10:
                        goto Label_00D7;
                    case 0x12:
                        goto Label_00E6;
                    case 0x13:
                        goto Label_0102;
                    case 20:
                        goto Label_010C;
                    case 0x16:
                        goto Label_011B;
                    case 0x17:
                        goto Label_0137;
                    case 0x18:
                        goto Label_0141;
                    case 0x1a:
                        goto Label_014D;
                    case 0x1b:
                        goto Label_0169;
                    case 0x1c:
                    case 0x57:
                        goto Label_06D0;
                    case 30:
                        goto Label_0180;
                    case 0x1f:
                        goto Label_019C;
                    case 0x22:
                        goto Label_01DD;
                    case 0x23:
                        goto Label_01FB;
                    case 0x24:
                        goto Label_020F;
                    case 0x25:
                        goto Label_0219;
                    case 0x26:
                        goto Label_0244;
                    case 0x27:
                        goto Label_026B;
                    case 40:
                        goto Label_0275;
                    case 0x29:
                        goto Label_027F;
                    case 0x2a:
                        goto Label_028D;
                    case 0x2b:
                        goto Label_02B2;
                    case 0x2c:
                        goto Label_02C1;
                    case 0x2d:
                        goto Label_02D3;
                    case 0x2e:
                        goto Label_02DD;
                    case 0x2f:
                        goto Label_02F2;
                    case 0x30:
                        goto Label_0302;
                    case 0x31:
                    case 0x37:
                    case 0x38:
                    case 0x3f:
                    case 0x45:
                    case 70:
                    case 0x55:
                    case 0x56:
                        goto Label_04FA;
                    case 50:
                        goto Label_030F;
                    case 0x33:
                        goto Label_0314;
                    case 0x34:
                        goto Label_031E;
                    case 0x35:
                        goto Label_032E;
                    case 0x36:
                        goto Label_0339;
                    case 0x39:
                        goto Label_034A;
                    case 0x3a:
                        goto Label_036F;
                    case 0x3b:
                        goto Label_0381;
                    case 60:
                        goto Label_038C;
                    case 0x3d:
                        goto Label_03A2;
                    case 0x3e:
                        goto Label_03B3;
                    case 0x40:
                        goto Label_03C1;
                    case 0x41:
                        goto Label_03C6;
                    case 0x42:
                        goto Label_03F1;
                    case 0x43:
                        goto Label_03FC;
                    case 0x44:
                        goto Label_040D;
                    case 0x47:
                        goto Label_041F;
                    case 0x48:
                        goto Label_0424;
                    case 0x49:
                        goto Label_042F;
                    case 0x4a:
                        goto Label_0441;
                    case 0x4b:
                        goto Label_044B;
                    case 0x4c:
                        goto Label_0461;
                    case 0x4d:
                        goto Label_0472;
                    case 0x4e:
                    case 0x53:
                    case 0x54:
                        goto Label_04CE;
                    case 0x4f:
                        goto Label_0480;
                    case 80:
                        goto Label_0485;
                    case 0x51:
                        goto Label_04B0;
                    case 0x52:
                        goto Label_04C1;
                    default:
                        goto Label_06C5;
                }
            Label_0685:
                num2 = num3;
                if ((num <= -2))
                {
                    expressionStack_694_0 = 1;
                }
                else
                {
                    expressionStack_694_0 = num;
                }
                switch (expressionStack_694_0)
                {
                    case 0:
                        goto Label_06C5;
                    case 1:
                        goto Label_0517;
                }
            }
            catch (Exception obj2)
            {
                ProjectData.SetProjectError((Exception)obj2);

            }

        Label_06C5:
            try
            {
                throw ProjectData.CreateProjectError(-2146828237);
            }catch(Exception ex)
            {
                MessageBox.Show(ex.Message, "Label_06C5 ERROR");
            }
        Label_06D0:
            if (num2 != 0)
            {
                ProjectData.ClearProjectError();
            }
            frmWait.newfrmWait1.Close();
        }

        private void  // ERROR: Handles clauses are not supported in C#
    CheckEdit1_CheckedChanged(System.Object sender, System.EventArgs e)
        {
            this.GridView1.OptionsBehavior.Editable = Convert.ToBoolean(this.CheckEdit1.EditValue);
            try
            {
                daCards.AcceptChangesDuringUpdate = true;
                daCards.Update(dsCards, "tblGeneral");
                dsCards.AcceptChanges();

            }
            catch (Exception ex)
            {

            }
        }

        private void  // ERROR: Handles clauses are not supported in C#
    GridView1_BeforeLeaveRow(object sender, DevExpress.XtraGrid.Views.Base.RowAllowEventArgs e)
        {
            try
            {
                daCards.AcceptChangesDuringUpdate = true;
                daCards.Update(dsCards, "tblGeneral");
                dsCards.AcceptChanges();
            }
            catch (Exception ex)
            {

            }
        }

        private void  // ERROR: Handles clauses are not supported in C#
    GridView1_RowUpdated(object sender, DevExpress.XtraGrid.Views.Base.RowObjectEventArgs e)
        {
            try
            {
                daCards.AcceptChangesDuringUpdate = true;
                daCards.Update(dsCards, "tblGeneral");
                dsCards.AcceptChanges();
            }
            catch (Exception ex)
            {

            }
        }

        public frmCards()
        {
            InitializeComponent();
        }
    }
}

